package com.ruoyi.web.controller.platform;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.vo.WarnDigestDTO;
import com.ruoyi.system.domain.vo.WarnDigestDetailVo;
import com.ruoyi.system.service.IMonitorDataService;
import com.ruoyi.web.dto.MonitorDetailDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/monitor/data")
public class MonitorDataController extends BaseController {

    @Autowired
    private IMonitorDataService monitorDataService;

    @GetMapping("/list")
    public AjaxResult list() {
        List<WarnDigestDTO> list = monitorDataService.getWarnDigestList();
        return success(list);
    }

    @PostMapping("/detailList")
    public AjaxResult detailList(@RequestBody MonitorDetailDto form) {
        List<WarnDigestDetailVo> list = monitorDataService.getWarnDetailList(form.getConfigId(), form.getType());
        return success(list);
    }

}
